package com.qf.listener;

import com.qf.pojo.User;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 演示事务消息:
 *  当生产者端事务处理成功后，消费者端才会收到消息
 */
@Component
@RocketMQMessageListener(consumerGroup="consumer-group1",topic="test2")
public class RocketMQListener6 implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        try {
            System.out.println("消费者6：" + message);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
